package com.ruibo.modules.quartz.model;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.sql.Update;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @description:
 * @author: 孙 峰
 * @time: 2020/10/15 16:51
 */
@Getter
@Setter
@Entity
@Table(name = "quartz_job")
public class QuartzJob implements Serializable {
    public static final String JOB_KEY = "JOB_KEY";

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 定时器名称
     */
    @Column(name = "job_name")
    private String jobName;

    /**
     * Bean名称
     */
    @Column(name = "bean_name")
    private String beanName;

    /**
     * 方法名称
     */
    @Column(name = "method_name")
    private String methodName;

    /**
     * 参数
     */
    @Column(name = "params")
    private String params;

    /**
     * cron表达式
     */
    @Column(name = "cron_expression")
    private String cronExpression;


    /**
     * 负责人
     */
    @Column(name = "person_in_charge")
    private String personInCharge;


    /**
     * 报警邮箱
     */
    private String email;
    /**
     * 失败后暂停
     */
    private Boolean pauseAfterFailure;
    /**
     * 状态
     */
    @Column(name = "is_pause")
    private Boolean isPause = false;

    /**
     * 备注
     */
    @Column(name = "remark")
    private String remark;

    @Column(name = "create_time")
    @CreationTimestamp
    private Timestamp createTime;
}
